﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Keepo.Models;

namespace AlbumDesigner.Models.Types
{
    public class FilmingDayData
    {
        public int FilmingDayId { get; set; }

        public string DateVal { get; set; }

        public int? PhotographerId { get; set; }
        public string Photographer { get; set; }

        public int? AlbumId { get; set; }
        public string AlbumTitle { get; set; }

        public FilmingDayData(FilmingDay filmingDay)
        {
            this.FilmingDayId = filmingDay.FilmingDayId;
            this.DateVal = filmingDay.Date.ToShortDateString();
            this.PhotographerId = filmingDay.PhotographerId;
            this.AlbumId = filmingDay.AlbumId;

            this.Photographer = "-";
            if (filmingDay.Photographer != null)
            {
                this.Photographer = filmingDay.Photographer.FirstName + " " + filmingDay.Photographer.LastName;
            }

            this.AlbumTitle = "-";
            if (filmingDay.Album != null)
            {
                this.AlbumTitle = filmingDay.Album.Title;
            }
        }
    }
}